package cn.csc.framework.jzb.config;

import lombok.Data;
import org.hibernate.validator.constraints.URL;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotEmpty;

/**
 * 见证宝接口属性注入
 * @author liuchuang
 * @version 1.0
 * @date 2023/3/9 16:59
 * @modify
 */
@ConfigurationProperties(prefix = "csc.jzb")
@Validated
@Data
public class JzbProperties {


    @NotEmpty(message = "签约客户号不能为空")
    private String mrchCode;

    @NotEmpty(message = "ECIF客户号不能为空")
    private String txnClientNo;

    @NotEmpty(message = "资金总账号不能为空")
    private String fundSummaryAcctNo;

    /**
     * app privateKey
     */
    @NotEmpty(message = "应用私钥不能为空")
    private String appPrivateKey;

    /**
     * platform publicKey
     */
    @NotEmpty(message = "平台公钥不能为空")
    private String publicKey;

    /**
     *  app id
     */
    @NotEmpty(message = "应用Id不能为空")
    private String appId;

    /**
     *  gateway url
     */
    @URL(message = "见证宝网关地址的格式必须是 URL")
    @NotEmpty(message = "见证宝网关地址不能为空")
    private String baseUrl;

    /**
     *  app secret
     */
    @NotEmpty(message = "应用密钥不能为空")
    private String appSecret;

    /**
     *  对账文件上传地址
     */
    @NotEmpty(message = "对账文件上传地址不能为空")
    private String fileUploadUrl;

    /**
     * 对账文件下载地址
     */
    @NotEmpty(message = "对账文件下载地址不能为空")
    private String fileDownLoadUrl;

    /**
     * 部署实例的ip，用于生成分布式ID
     */
    @NotEmpty(message = "部署实例的ip不能为空")
    private String ip;

}
